﻿var valid;

$(document).ready(function () {
    validate();

    if (valid) {
        var $stdNum, $lang, $notify;
        $lang = getLanguage();
        $notify = "";

        $("#science2011_registration form").validate({
            errorElement: "em",
            success: function (em) {
                em.text(" ").addClass("valid");
            },
            submitHandler: function (form) {
                var $ld_cname = $("#science2011_registration #leader_cname").val();
                var $ld_pname = $("#science2011_registration #leader_pname").val();
                var $ld_tel = $("#science2011_registration #leader_tel").val();
                var $ld_mail = $("#science2011_registration #leader_mail").val();
                var $ld_class = $("#science2011_registration #leader_class").val();
                var $mb1_cname = $("#science2011_registration #mb1_cname").val();
                var $mb1_pname = $("#science2011_registration #mb1_pname").val();
                var $mb1_tel = $("#science2011_registration #mb1_tel").val();
                var $mb1_mail = $("#science2011_registration #mb1_mail").val();
                var $mb1_class = $("#science2011_registration #mb1_class").val();
                var $mb2_cname = $("#science2011_registration #mb2_cname").val();
                var $mb2_pname = $("#science2011_registration #mb2_pname").val();
                var $mb2_tel = $("#science2011_registration #mb2_tel").val();
                var $mb2_mail = $("#science2011_registration #mb2_mail").val();
                var $mb2_class = $("#science2011_registration #mb2_class").val();
                var $mb3_cname = $("#science2011_registration #mb3_cname").val();
                var $mb3_pname = $("#science2011_registration #mb3_pname").val();
                var $mb3_tel = $("#science2011_registration #mb3_tel").val();
                var $mb3_mail = $("#science2011_registration #mb3_mail").val();
                var $mb3_class = $("#science2011_registration #mb3_class").val();
                var $scl_name = $("#science2011_registration #scl_name").val();
                var $tc_cname = $("#science2011_registration #tc_cname").val();
                var $tc_pname = $("#science2011_registration #tc_pname").val();
                var $tc_tel = $("#science2011_registration #tc_tel").val();
                var $tc_mail = $("#science2011_registration #tc_mail").val();
                $.get("/asp/2011science/email.asp", { language: $lang, notify: $notify, ld_cname: $ld_cname, ld_pname: $ld_pname, ld_tel: $ld_tel, ld_mail: $ld_mail, ld_class: $ld_class, mb1_cname: $mb1_cname, mb1_pname: $mb1_pname, mb1_tel: $mb1_tel, mb1_mail: $mb1_mail, mb1_class: $mb1_class, mb2_cname: $mb2_cname, mb2_pname: $mb2_pname, mb2_tel: $mb2_tel, mb2_mail: $mb2_mail, mb2_class: $mb2_class, mb3_cname: $mb3_cname, mb3_pname: $mb3_pname, mb3_tel: $mb3_tel, mb3_mail: $mb3_mail, mb3_class: $mb3_class, scl_name: $scl_name, tc_cname: $tc_cname, tc_pname: $tc_pname, tc_tel: $tc_tel, tc_mail: $tc_mail }, function (data) {
                    //alert(data);
                    $("#science2011_registration .confirm").fadeOut();
                    $("#science2011_registration form").fadeOut();
                    $("#science2011_registration form").after('<div id="success">' + getErrorMsg("SUCCESS", $lang) + '</div>');
                });
            }
        });

        $("#science2011_registration #notify").click(function () {
            if ($(this).attr("checked")) {
                $notify = $(this).val();
            }
            else {
                $notify = "";
            }
        });

        $("#science2011_registration #num_btn").click(function () {
            var $errorMsg;

            $stdNum = $("#science2011_registration #s_number").val();

            if ($stdNum == "1" || $stdNum == "2" || $stdNum == "3" || $stdNum == "4") {
                showStudentInput($stdNum);
            }
            else {
                showStudentInput($stdNum);
                $errogMsg = getErrorMsg("NUM_INVAILD", $lang);
                alert($errogMsg);
            }

            switch ($stdNum) {
                case "1":
                    $("#science2011_registration #leader_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #leader_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #leader_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_cname").rules("remove", "required");
                    $("#science2011_registration #mb1_pname").rules("remove", "required");
                    $("#science2011_registration #mb1_tel").rules("remove", "required");
                    $("#science2011_registration #mb1_mail").rules("remove", "required");
                    $("#science2011_registration #mb1_class").rules("remove", "required");
                    $("#science2011_registration #mb2_cname").rules("remove", "required");
                    $("#science2011_registration #mb2_pname").rules("remove", "required");
                    $("#science2011_registration #mb2_tel").rules("remove", "required");
                    $("#science2011_registration #mb2_mail").rules("remove", "required");
                    $("#science2011_registration #mb2_class").rules("remove", "required");
                    $("#science2011_registration #mb3_cname").rules("remove", "required");
                    $("#science2011_registration #mb3_pname").rules("remove", "required");
                    $("#science2011_registration #mb3_tel").rules("remove", "required");
                    $("#science2011_registration #mb3_mail").rules("remove", "required");
                    $("#science2011_registration #mb3_class").rules("remove", "required");
                    $("#science2011_registration #scl_name").rules("add", { required: true, messages: { required: getErrorMsg("SCHOOL_REQUIRED", $lang)} });
                    $("#science2011_registration #tc_tel").rules("add", { number: true, messages: { number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #tc_mail").rules("add", { email: true, messages: { email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    break;
                case "2":
                    $("#science2011_registration #leader_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #leader_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #leader_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #mb1_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #mb1_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb2_cname").rules("remove", "required");
                    $("#science2011_registration #mb2_pname").rules("remove", "required");
                    $("#science2011_registration #mb2_tel").rules("remove", "required");
                    $("#science2011_registration #mb2_mail").rules("remove", "required");
                    $("#science2011_registration #mb2_class").rules("remove", "required");
                    $("#science2011_registration #mb3_cname").rules("remove", "required");
                    $("#science2011_registration #mb3_pname").rules("remove", "required");
                    $("#science2011_registration #mb3_tel").rules("remove", "required");
                    $("#science2011_registration #mb3_mail").rules("remove", "required");
                    $("#science2011_registration #mb3_class").rules("remove", "required");
                    $("#science2011_registration #scl_name").rules("add", { required: true, messages: { required: getErrorMsg("SCHOOL_REQUIRED", $lang)} });
                    $("#science2011_registration #tc_tel").rules("add", { number: true, messages: { number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #tc_mail").rules("add", { email: true, messages: { email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    break;
                case "3":
                    $("#science2011_registration #leader_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #leader_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #leader_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #mb1_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #mb1_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb2_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb2_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb2_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #mb2_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #mb2_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb3_cname").rules("remove", "required");
                    $("#science2011_registration #mb3_pname").rules("remove", "required");
                    $("#science2011_registration #mb3_tel").rules("remove", "required");
                    $("#science2011_registration #mb3_mail").rules("remove", "required");
                    $("#science2011_registration #mb3_class").rules("remove", "required");
                    $("#science2011_registration #scl_name").rules("add", { required: true, messages: { required: getErrorMsg("SCHOOL_REQUIRED", $lang)} });
                    $("#science2011_registration #tc_tel").rules("add", { number: true, messages: { number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #tc_mail").rules("add", { email: true, messages: { email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    break;
                case "4":
                    $("#science2011_registration #leader_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #leader_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #leader_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #leader_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb1_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #mb1_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #mb1_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb2_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb2_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb2_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #mb2_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #mb2_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #mb3_cname").rules("add", { required: true, messages: { required: getErrorMsg("CNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb3_pname").rules("add", { required: true, messages: { required: getErrorMsg("PNAME_REQUIRED", $lang)} });
                    $("#science2011_registration #mb3_tel").rules("add", { required: true, number: true, messages: { required: getErrorMsg("TEL_REQUIRED", $lang), number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #mb3_mail").rules("add", { required: true, email: true, messages: { required: getErrorMsg("EMAIL_REQUIRED", $lang), email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    $("#science2011_registration #mb3_class").rules("add", { required: true, messages: { required: getErrorMsg("CLASS_REQUIRED", $lang)} });
                    $("#science2011_registration #scl_name").rules("add", { required: true, messages: { required: getErrorMsg("SCHOOL_REQUIRED", $lang)} });
                    $("#science2011_registration #tc_tel").rules("add", { number: true, messages: { number: getErrorMsg("TEL_INVALID", $lang)} });
                    $("#science2011_registration #tc_mail").rules("add", { email: true, messages: { email: getErrorMsg("EMAIL_INVALID", $lang)} });
                    break;
                default:
                    $("#science2011_registration #leader_cname").rules("remove", "required");
                    $("#science2011_registration #leader_pname").rules("remove", "required");
                    $("#science2011_registration #leader_tel").rules("remove", "required");
                    $("#science2011_registration #leader_mail").rules("remove", "required");
                    $("#science2011_registration #leader_class").rules("remove", "required");
                    $("#science2011_registration #mb1_cname").rules("remove", "required");
                    $("#science2011_registration #mb1_pname").rules("remove", "required");
                    $("#science2011_registration #mb1_tel").rules("remove", "required");
                    $("#science2011_registration #mb1_mail").rules("remove", "required");
                    $("#science2011_registration #mb1_class").rules("remove", "required");
                    $("#science2011_registration #mb2_cname").rules("remove", "required");
                    $("#science2011_registration #mb2_pname").rules("remove", "required");
                    $("#science2011_registration #mb2_tel").rules("remove", "required");
                    $("#science2011_registration #mb2_mail").rules("remove", "required");
                    $("#science2011_registration #mb2_class").rules("remove", "required");
                    $("#science2011_registration #mb3_cname").rules("remove", "required");
                    $("#science2011_registration #mb3_pname").rules("remove", "required");
                    $("#science2011_registration #mb3_tel").rules("remove", "required");
                    $("#science2011_registration #mb3_mail").rules("remove", "required");
                    $("#science2011_registration #mb3_class").rules("remove", "required");
                    $("#science2011_registration #scl_name").rules("remove", "required");
                    break;
            }

            return false;
        });
    }
    else {
        $("#science2011_registration #s_number").attr("disabled", "disabled");
        $("#science2011_registration #num_btn").attr("disabled", "disabled");
    }

});

function validate() {
    var options;
    options = { type: "POST", url: "/asp/2010science/validate.asp", success: getValid };
    $.ajax(options);
}

function getValid(responseText, statusText, xhr, $form) {
    if (responseText == "EXPIRED") {
        valid = false;
    }
    else {
        valid = true;
    }

}

function showStudentInput(num) {
    switch (num) {
        case "1":
            $("#science2011_registration .leader").fadeIn();
            $("#science2011_registration .member1").fadeOut();
            $("#science2011_registration .member2").fadeOut();
            $("#science2011_registration .member3").fadeOut();
            $("#science2011_registration #school_field").fadeIn();
            $("#science2011_registration #agreement").fadeIn();
            $("#science2011_registration #btn_field").fadeIn();
            break;
        case "2":
            $("#science2011_registration .leader").fadeIn();
            $("#science2011_registration .member1").fadeIn();
            $("#science2011_registration .member2").fadeOut();
            $("#science2011_registration .member3").fadeOut();
            $("#science2011_registration #school_field").fadeIn();
            $("#science2011_registration #agreement").fadeIn();
            $("#science2011_registration #btn_field").fadeIn();
            break;
        case "3":
            $("#science2011_registration .leader").fadeIn();
            $("#science2011_registration .member1").fadeIn();
            $("#science2011_registration .member2").fadeIn();
            $("#science2011_registration .member3").fadeOut();
            $("#science2011_registration #school_field").fadeIn();
            $("#science2011_registration #agreement").fadeIn();
            $("#science2011_registration #btn_field").fadeIn();
            break;
        case "4":
            $("#science2011_registration .leader").fadeIn();
            $("#science2011_registration .member1").fadeIn();
            $("#science2011_registration .member2").fadeIn();
            $("#science2011_registration .member3").fadeIn();
            $("#science2011_registration #school_field").fadeIn();
            $("#science2011_registration #agreement").fadeIn();
            $("#science2011_registration #btn_field").fadeIn();
            break;
        default:
            $("#science2011_registration .leader").fadeOut();
            $("#science2011_registration .member1").fadeOut();
            $("#science2011_registration .member2").fadeOut();
            $("#science2011_registration .member3").fadeOut();
            $("#science2011_registration #school_field").fadeOut();
            $("#science2011_registration #agreement").fadeOut();
            $("#science2011_registration #btn_field").fadeOut();
            break;
    }
}

function getLanguage() {
    var $lang = $("meta[http-equiv=Content-Language]").attr("content");
    if (!$lang) {
        var $lang = $("meta[httpEquiv=Content-Language]").attr("content");
    }
    switch ($lang) {
        case "zh-tw":
            return "chi";
            break;
        case "zh-cn":
            return "chis";
            break;
        case "en-gb":
            return "eng";
            break;
        case "pt":
            return "por";
            break;
        default:
            return "eng";
            break;
    }
}

function getErrorMsg(caption,lang) {
    switch (caption) {
        case "SUCCESS":
            switch (lang) {
                case "chi":
                    return "多謝您的參與，您的報名表已經寄出，若線上報名成功，我們的工作人員將於<strong>兩個工作日</strong>內與你聯系確認。若沒有收到確認電話，請即與我們聯絡 (電話：2871 8063 / 2871 8570；傳真：28718018；電郵：info@macao.communications.museum)。";
                    break;
                case "chis":
                    return "多谢您的参与，您的报名表已经寄出，若线上报名成功，我们的工作人员将于<strong>两个工作日</strong>内与你联系确认。若没有收到确认电话，请即与我们联络 (电话：2871 8063 / 2871 8570；传真：28718018；电邮：info@macao.communications.museum)。";
                    break;
                case "por":
                    return "Obrigado pela sua participação. A ficha de inscrição foi-nos submetida. O seu pedido vai ser processado e vamos contactá-lo dentro de dois dias úteis se a inscrição for completada. Para qualquer informação adicional é favor contactar, através de telefone: 28718063 / 28718570, fax: 28718018 ou E-mail: info@macao.communications.museum";
                    break;
                case "eng":
                    return "Thank you for your participation. Your registration form has been submitted. If your online registration is successful, our staff will contact you for further arrangement within two working days. Any inquiries please contact us (Tel: 28718063 / 28718570; Fax: 28718018; Email: info@macao.communications.museum)";
                    break;
            }
            break;
        case "NUM_INVAILD":
            switch (lang) {
                case "chi":
                    return "每組可由1至4名學生組成";
                    break;
                case "chis":
                    return "每组可由1至4名学生组成";
                    break;
                case "por":
                    return "1 - 4 estudantes por grupo";
                    break;
                case "eng":
                    return "One to four students per team";
                    break;
            }
            break;
        case "CNAME_REQUIRED":
            switch (lang) {
                case "chi":
                    return "請輸入中文姓名";
                    break;
                case "chis":
                    return "请输入中文姓名";
                    break;
                case "por":
                    return "Preencha o seu name em Chinês";
                    break;
                case "eng":
                    return "Please fill in name in Chinese";
                    break;
            }
            break;
        case "PNAME_REQUIRED":
            switch (lang) {
                case "chi":
                    return "請輸入葡文姓名";
                    break;
                case "chis":
                    return "请输入葡文姓名";
                    break;
                case "por":
                    return "Preencha o seu name em Português";
                    break;
                case "eng":
                    return "Please fill in name in Portugues";
                    break;
            }
            break;
        case "TEL_REQUIRED":
            switch (lang) {
                case "chi":
                    return "請輸入聯絡電話";
                    break;
                case "chis":
                    return "请输入联络电话";
                    break;
                case "por":
                    return "Preencha o seu telefone";
                    break;
                case "eng":
                    return "Please fill in tel.";
                    break;
            }
            break;
        case "TEL_INVALID":
            switch (lang) {
                case "chi":
                    return "請輸入正確的電話號碼";
                    break;
                case "chis":
                    return "请输入正确的电话号码";
                    break;
                case "por":
                    return "Preencha um endereço de telefone correcto";
                    break;
                case "eng":
                    return "Please fill in correct tel.";
                    break;
            }
            break;
        case "EMAIL_REQUIRED":
            switch (lang) {
                case "chi":
                    return "請輸入聯絡電郵";
                    break;
                case "chis":
                    return "请输入联络电邮";
                    break;
                case "por":
                    return "Preencha o endereço de E-mail";
                    break;
                case "eng":
                    return "Please fill in E-mail";
                    break;
            }
            break;
        case "EMAIL_INVALID":
            switch (lang) {
                case "chi":
                    return "請輸入正確的電郵";
                    break;
                case "chis":
                    return "请输入正确的电邮";
                    break;
                case "por":
                    return "Preencha um endereço de E-mail correcto";
                    break;
                case "eng":
                    return "Please fill in correct E-mail";
                    break;
            }
            break;
        case "CLASS_REQUIRED":
            switch (lang) {
                case "chi":
                    return "請輸入就讀年級";
                    break;
                case "chis":
                    return "请输入就读年级";
                    break;
                case "por":
                    return "Preencha o seu ano";
                    break;
                case "eng":
                    return "Please fill in grade";
                    break;
            }
            break;
        case "SCHOOL_REQUIRED":
            switch (lang) {
                case "chi":
                    return "請輸入學校名稱";
                    break;
                case "chis":
                    return "请输入学校名称";
                    break;
                case "por":
                    return "Preencha o seu nome da escola";
                    break;
                case "eng":
                    return "Please fill in name of school";
                    break;
            }
            break;
        default:
            break;
    }
}